import type { PageParams, PageResult } from "@/types/global"
import type { BannerItem, CategoryItem, GuessItem, HotItem } from "@/types/home"
import { http } from "@/utils/https"

//获取banner信息
export const getHomeBannerApi = (distributionSite = 1) => {
  return http<BannerItem[]>({
    url:'/home/banner',
    method:'GET',
    data:{
      distributionSite
    }
  })
}

//首页-前台分类-小程序
export const getHomeCategoryApi = () => {
  return http<CategoryItem[]>({
    method:'GET',
    url:'/home/category/mutli',
  })
}

//首页-热门推荐-小程序
export const getHomeHotApi = () => {
  return http<HotItem[]>({
    method:'GET',
    url:'/home/hot/mutli',
  })
}

//猜你喜欢-小程序
export const getHomeGoodsGuessLikeApi = (data?: PageParams) => {
  return http<PageResult<GuessItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data
  })
}